-
Notifications
You must be signed in to change notification settings - Fork 111
Fix silent serialization failure when publishing non-JSON-serializable objects #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| except TypeError as e: | ||
| exc = PubNubException( | ||
| errormsg=str(e), | ||
| pn_error=PNERR_JSON_NOT_SERIALIZABLE | ||
| ) | ||
| status = PNStatus() | ||
| status.category = PNStatusCategory.PNSerializationErrorCategory | ||
| status.error = True | ||
| status.error_data = PNErrorData(str(exc), exc) | ||
| exc.status = status | ||
| raise exc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error structure has a circular reference, PubNubException.status.error_data.exception points back to the same PubNubException. This PR implements a fix that works within the current model to prevent regressions, but the error hierarchy would benefit from being revisited in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Good find and fast fix thank you 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix, I reported this to @stephenlb first at 2:48am IST and less than 24hrs it's fixed!
This was discovered by using a custom agent creating a tool on the fly in remote VPSs instance.
No description provided.